{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Error/index.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { Context } from \"../../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { Alert, AlertTitle } from \"@mui/material\";\nimport styles from './Error.module.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Error = _ref => {\n  _s();\n  let {\n    text = 'Неизвестная ошибка'\n  } = _ref;\n  const {\n    store\n  } = React.useContext(Context);\n  if (store.getIsError()) {\n    return /*#__PURE__*/_jsxDEV(Alert, {\n      className: styles.errorAlert,\n      severity: \"error\",\n      onClose: () => {\n        store.setIsError(false);\n      },\n      children: [/*#__PURE__*/_jsxDEV(AlertTitle, {\n        children: \"\\u0423\\u043F\\u0441, \\u0447\\u0442\\u043E-\\u0442\\u043E \\u043F\\u043E\\u0448\\u043B\\u043E \\u043D\\u0435 \\u0442\\u0430\\u043A...\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 15,\n        columnNumber: 17\n      }, this), \"\\u041F\\u0440\\u0438\\u0447\\u0438\\u043D\\u0430 \\u043E\\u0448\\u0438\\u0431\\u043A\\u0438 \\u2014 \", /*#__PURE__*/_jsxDEV(\"strong\", {\n        children: text\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 16,\n        columnNumber: 34\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 14,\n      columnNumber: 13\n    }, this);\n  }\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: styles.disableError\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 22,\n    columnNumber: 9\n  }, this);\n};\n_s(Error, \"fWWYyndAah+pK9pcP7nWnrsVVfw=\");\n_c = Error;\nexport default _c2 = observer(Error);\nvar _c, _c2;\n$RefreshReg$(_c, \"Error\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Context","observer","Alert","AlertTitle","styles","Error","text","store","useContext","getIsError","errorAlert","setIsError","disableError"],"sources":["/data/messenger.client/src/components/Error/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {Context} from \"../../index\";\nimport {observer} from \"mobx-react-lite\";\nimport {Alert, AlertTitle} from \"@mui/material\";\nimport {AlertProps} from \"../../models/props/AlertProps\";\nimport styles from './Error.module.scss';\n\nconst Error: React.FC<AlertProps> = ({text = 'Неизвестная ошибка'}) => {\n    const {store} = React.useContext(Context);\n\n    if (store.getIsError()) {\n\n        return (\n            <Alert className={styles.errorAlert} severity=\"error\" onClose={() => {store.setIsError(false)}}>\n                <AlertTitle>Упс, что-то пошло не так...</AlertTitle>\n                Причина ошибки — <strong>{text}</strong>\n            </Alert>\n        );\n    }\n\n    return (\n        <div className={styles.disableError}></div>\n    );\n}\n\nexport default observer(Error);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,OAAO,QAAO,aAAa;AACnC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,KAAK,EAAEC,UAAU,QAAO,eAAe;AAE/C,OAAOC,MAAM,MAAM,qBAAqB;AAAC;AAEzC,MAAMC,KAA2B,GAAG,QAAmC;EAAA;EAAA,IAAlC;IAACC,IAAI,GAAG;EAAoB,CAAC;EAC9D,MAAM;IAACC;EAAK,CAAC,GAAGR,KAAK,CAACS,UAAU,CAACR,OAAO,CAAC;EAEzC,IAAIO,KAAK,CAACE,UAAU,EAAE,EAAE;IAEpB,oBACI,QAAC,KAAK;MAAC,SAAS,EAAEL,MAAM,CAACM,UAAW;MAAC,QAAQ,EAAC,OAAO;MAAC,OAAO,EAAE,MAAM;QAACH,KAAK,CAACI,UAAU,CAAC,KAAK,CAAC;MAAA,CAAE;MAAA,wBAC3F,QAAC,UAAU;QAAA;MAAA;QAAA;QAAA;QAAA;MAAA,QAAyC,0GACnC;QAAA,UAASL;MAAI;QAAA;QAAA;QAAA;MAAA,QAAU;IAAA;MAAA;MAAA;MAAA;IAAA,QACpC;EAEhB;EAEA,oBACI;IAAK,SAAS,EAAEF,MAAM,CAACQ;EAAa;IAAA;IAAA;IAAA;EAAA,QAAO;AAEnD,CAAC;AAAA,GAhBKP,KAA2B;AAAA,KAA3BA,KAA2B;AAkBjC,qBAAeJ,QAAQ,CAACI,KAAK,CAAC;AAAC;AAAA;AAAA"},"metadata":{},"sourceType":"module"}